<%-- 
    Document   : pedido
    Created on : 14/03/2013, 11:14:14 AM
    Author     : user10
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Alta Pedido</title>

        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/skins/dhtmlxform_dhx_skyblue.css">
        <script src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/dhtmlxcommon.js"></script>
        <script src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/dhtmlxform.js"></script>


    </head>
    <body>
        <div id="myForm" style="height:500px;"></div>
        <script>
            var myForm,
            formData;
          
            formData = [{
                    type: "settings",
                    position: "label-left",
                    labelWidth: 130,
                    inputWidth: 120
                }, {
                    type: "fieldset",
                    label: "Alta Pedido",
                    inputWidth: "auto",
                    list: [
                         {
                            type: "input",
                            label: "Clave Empresa",
                            name: "claveEmpresa",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "Fecha",
                            name: "fecha",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "Dirección",
                            name: "direccion",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label:"Colonia",
                            name: "colonia",
                            value: "",
                            required: true
                        }
                        ,  {
                            type: "input",
                            label: "Municipio",
                            name: "municipio",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "Codigo Postal",
                            name: "codigoPostal",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "Clave Usuario",
                            name: "claveUsuario",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label:"Notas",
                            name: "notasRecibe",
                            value: "",
                            required: true
                        }
                        , {
                            type: "input",
                            label:"Total",
                            name: "total",
                            value: "",
                            required: true
                        }
                        ,  {
                            type: "input",
                            label: "Fecha de Pedido",
                            name: "fechaPedido",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "Fecha de Entrega",
                            name: "fechaEntrega",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label: "Para",
                            name: "nombrePersonaEntregar",
                            value: "",
                            required: true
                        },{
                            type: "input",
                            label:"Status",
                            name: "status",
                            value: "",
                            required: true
                        }
                        ,{
                            type: "button",
                            name:"guardar",
                            value: "Guardar"
                        }]
                }];
           
            myForm = new dhtmlXForm("myForm", formData);
             myForm.enableLiveValidation(true);
             myForm.attachEvent("onButtonClick", function(id) {
                  if(id=="guardar"){
                      
                     
                  if(myForm.validate()){
                      myForm.send("insertPedido","get"); 
                  }
     
          }
           })
           
        </script>
    </body>
</html>